<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        .tab-button {
            padding: 6px 10px;
            border-top-left-radius: 3px;
            border-top-right-radius: 3px;
            border: 1px solid #ccc;
            cursor: pointer;
            background: #f0f0f0;
            margin-bottom: -1px;
            margin-right: -1px;
        }
        .tab-button:hover {
            background: #e0e0e0;
        }
        .tab-button.active {
            background: #e0e0e0;
        }
        .tab {
            border: 1px solid #ccc;
            padding: 10px;
        }
        .fade-enter-active, .fade-leave-active {
            transition: opacity 1.5s;
        }
        .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
            opacity: 0;
        }

        /* 可以设置不同的进入和离开动画 */
        /* 设置持续时间和动画函数 */
        .slide-fade-enter-active {
            transition: all .3s ease;
        }
        .slide-fade-leave-active {
            transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
        }
        .slide-fade-enter, .slide-fade-leave-to
            /* .slide-fade-leave-active for below version 2.1.8 */ {
            transform: translateX(10px);
            opacity: 0;
        }

        .bounce-enter-active {
            animation: bounce-in .5s;
        }
        .bounce-leave-active {
            animation: bounce-in .5s reverse;
        }
        @keyframes bounce-in {
            0% {
                transform: scale(0);
            }
            50% {
                transform: scale(1.5);
            }
            100% {
                transform: scale(1);
            }
        }
    </style>
    <link href="https://cdn.jsdelivr.net/npm/animate.css@3.5.1" rel="stylesheet" type="text/css">
</head>

<!-- 开发环境版本，包含了用帮助的命令行警告 -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

<!-- 生产环境版本，优化了尺寸和速度 -->
<!--<script src="https://cdn.jsdelivr.net/npm/vue"></script> -->
<body>
    <div id="app">
        {{message}}
    </div>

    <div id="app-2">
        <span v-bind:title="message">
            鼠标悬停几秒钟查看此处动态绑定的提示信息！
        </span>
    </div>

    <div id="app-3">
        <p v-if="seen">现在你看到我了</p>
    </div>

    <div id="app-4">
        <li v-for="todo in todos">
            {{todo.text}}
        </li>
    </div>

    <div id="app-5">
        <p>{{message}}</p>
        <button v-on:click="reverseMessage">逆转消息</button>
    </div>

    <div id="app-6">
        <p>{{message}}</p>
        <input v-model="message">
    </div>

    <div id="dynamic-component-demo" class="demo">
        <button
                v-for="tab in tabs"
                v-bind:key="tab"
                v-bind:class="['tab-button', { active: currentTab === tab }]"
                v-on:click="currentTab = tab"
        >{{ tab }}</button>

        <component
                v-bind:is="currentTabComponent"
                class="tab"
        ></component>
    </div>
    <div>
        <google-map>
            <google-map-markers v-bind:places="iceCreamShops"></google-map-markers>
        </google-map>
    </div>

    <div id="demo">
        <button v-on:click="show = !show">
            Toggle
        </button>
        <transition name="fade">
            <p v-if="show">hello</p>
        </transition>
    </div>

    <div id="example-1">
        <button @click="show = !show">
            Toggle render
        </button>
        <transition name="slide-fade">
            <p v-if="show">hello</p>
        </transition>
    </div>

    <div id="example-2">
        <button @click="show = !show">Toggle show</button>
        <transition name="bounce">
            <p v-if="show">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris facilisis enim libero, at lacinia diam fermentum id. Pellentesque habitant morbi tristique senectus et netus.</p>
        </transition>
    </div>

    <div id="example-3">
        <button @click="show = !show">
            Toggle render
        </button>
        <transition
                name="custom-classes-transition"
                enter-active-class="animated tada"
                leave-active-class="animated bounceOutRight"
        >
            <p v-if="show">hello</p>
        </transition>
    </div>

</body>


<script>
    var app = new Vue({
        el:'#app',
        data:{
            message:'Hello,Vue!'
        }
    })
    var app2 = new Vue({
        el:'#app-2',
        data:{
            message:'页面加载于 '+new Date().toLocaleString()
        }
    })
    var app3 = new Vue({
        el:'#app-3',
        data:{
            seen:true
        }
    })
    var app4 = new Vue({
        el:'#app-4',
        data:{
            todos:[
                {text:'学习1'},
                {text:'学习2'},
                {text:'学习3'}
            ]
        }
    })
    var app5 = new Vue({
        el:'#app-5',
        data:{
            message:'Hello Vue.js'
        },
        methods:{
            reverseMessage:function () {
                this.message = this.message.split('').reverse().join('')
            }
        }
    })
    var app6 = new Vue({
        el:'#app-6',
        data:{
            message:'Hello Vue.js'
        }
    })

    Vue.component('tab-home', {
        template: '<div>Home component</div>'
    })
    Vue.component('tab-posts', {
        template: '<div>Posts component</div>'
    })
    Vue.component('tab-archive', {
        template: '<div>Archive component</div>'
    })

    new Vue({
        el: '#dynamic-component-demo',
        data: {
            currentTab: 'Home',
            tabs: ['Home', 'Posts', 'Archive']
        },
        computed: {
            currentTabComponent: function () {
                return 'tab-' + this.currentTab.toLowerCase()
            }
        }
    })

    new Vue({
        el: '#demo',
        data: {
            show: true
        }
    })

    new Vue({
        el: '#example-1',
        data: {
            show: true
        }
    })

    new Vue({
        el: '#example-2',
        data: {
            show: true
        }
    })

    new Vue({
        el: '#example-3',
        data: {
            show: true
        }
    })
</script>

</html>